﻿using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;

namespace Microsoft.EntityFrameworkCore;

public static class MySqlDbContextOptionsBuilderExtensions
{
    public static DbContextOptionsBuilder UseMySql(this DbContextOptionsBuilder optionsBuilder, string? connectionString, Action<MySqlDbContextOptionsBuilder>? mySqlOptionsAction = null)
    {
        return optionsBuilder.UseMySql(connectionString ?? throw new ArgumentNullException("MySql连接字符串为空"), ServerVersion.AutoDetect(connectionString));
    }
}